<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		
		window.onload= function () {
			
			pList = document.getElementsByTagName('p');

			for (var i = 0; i < pList.length; i++) {

				if(i%2==0){
					pList[i].style.background="blue";
					pList[i].style.color="#fff";
					pList[i].style.fontSize = "20px"
				}
				
			}
		}

	</script>
</head>
<body>
	<p>学并思1</p>
	<p>学并思2</p>
	<p>学并思3</p>
	<p>学并思4</p>
	<p>学并思5</p>
	<p>学并思6</p>
	<p>学并思7</p>
	<p>学并思8</p>
	<p>学并思9</p>
	<p>学并思10</p>
	<p>学并思11</p>
	<p>学并思12</p>
	<p>学并思13</p>
	<p>学并思14</p>
	<p>学并思15</p>
	<p>学并思16</p>
	<p>学并思17</p>
	<p>学并思18</p>
	<p>学并思19</p>
	<p>学并思20</p>
</body>
</html>